
	$(function() {
		var testList = $(".numdiv");
		for (i = 0; i < testList.length; i++) {
			$(testList[i]).val(comdify($(testList[i]).val()));
		}
	});

	function comdify(thisobj) {
		thisobj = thisobj.replace(/,/g, "");
		var re = /\d{1,3}(?=(\d{3})+$)/g;
		var n1 = thisobj.replace(/^(\d+)((\.\d+)?)$/,
				function(s, s1, s2) {
					return s1.replace(re, "$&,") + s2;
				});
		return n1;
	}







$(function() {
$(".numdiv").keyup(function() {
var tValue = $(this).val();
tValue = tValue.replace(/,/g, "");
var re = /\d{1,3}(?=(\d{3})+$)/g;
var n1 = tValue.replace(/^(\d+)((\.\d+)?)$/, function(s, s1, s2) {
return s1.replace(re, "$&,") + s2;
});
$(this).val(n1);
});
});
